home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / asm / alib11b.zip / CODE1.ZIP / DISKFILE / FSIZE.ASM < prev    next >
Assembly Source File  |  1994-10-04  |  742b  |  30 lines

  1.     page    66,132
  2. ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -(  DISK   )
  3. FILE_COUNT - counts the number of files matching an ASCIIZ filespec string.
  4. ;
  5. ; inputs:    DS:[DX] pointing to filespec string
  6. ;            CX = file attributes
  7. ;            
  8. ; output:    AX = number of files matching the filespec string
  9. ;
  10. ; notes:     The filespec string may include the '*' and '?' wildcards.
  11. ;* * * * * * * * * * * * * *
  12.  
  13.     public    FILE_COUNT
  14. FILE_COUNT    PROC    FAR
  15.    push    bp
  16.    cld
  17.    XOR     BP,BP
  18.    MOV       AH,4Eh        ;find first file
  19. FC_01:
  20.    INT     21h
  21.    JB      FC_02
  22.    INC     BP
  23.    MOV       AH,4Fh        ;find next file
  24.    JMP     FC_01
  25. FC_02:
  26.    MOV     AX,BP
  27.    POP     BP
  28.    RETF
  29. FILE_COUNT    ENDP
  30.